import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { RichTextModule } from './rich-text/rich-text.module';
import { CorsMiddleware } from './cors.middleware';
@Module({
  imports: [RichTextModule],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule implements NestModule {
  configure(consumer: MiddlewareConsumer) {
    consumer.apply(CorsMiddleware).forRoutes('*'); //设置需要应用中间件的路由路径，此处为所有路由
  }
}
